<template>
	<view class="PUC" style="background: url(../../static/imgs/userImgs/pickUpCode-background.png) no-repeat center center;
	background-size: cover;">
		<view class="puc-container">
			<view class="puc-title">
				提货码
			</view>
			<view class="puc-QRCode">
				<view class="puc-line1">
					<image :src="img" mode=""></image>
				</view>
				<view class="puc-line2" ref="PUCode" >
					{{PUCode}}
				</view>
				
					<text class="button3" @click="copyPuc">复制提货码</text>
				
			</view>
		</view>
	</view>
</template>

<script>
	var _self = this
	export default {	
		data() {
			return {
				img:"",
				key: 'value',
				PUCode: '89DDFF'
			}
		},
		onHide() {
			
		},
		onLoad(item) {
			let code = JSON.parse(item.item)
			this.img = code.pullqrcode
			this.PUCode = code.pullword
			let id = 4
			uni.setStorageSync('user-orderId', id);
		},
		methods: {
			copyPuc() {
				// let a = this.$refs.PUCode.$el.innerText
				// console.log(a)
				// console.log(this.$refs.PUCode)
				uni.setClipboardData({
				    data: this.PUCode,
				    success: function () {
				        uni.showToast({
				        	title: '已复制到剪切板',
							icon:'none'
				        });
				    }
				});
			}
		},
	}
</script>

<style lang="scss" scoped>
@import 'static/css/smallCommon.scss'
</style>